Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tracking log for completion events #245

Merged
merged 5 commits into from
Sep 21, 2023

Conversation

Ian2012
Copy link
Contributor

@Ian2012 Ian2012 commented Aug 22, 2023

Description: This PR emits a tracking log for every completion event (created/updated).

Related issue: openedx/openedx-aspects#88

Installation instructions: List any non-trivial installation
instructions.

Testing instructions:

  • Create a problem in an empty unit.
  • Go to the LMS and finish the problem.
  • Verify a tracking log named: edx.completion.block_completion.changed is emitted with the proper information

Reviewers:

  • tag reviewer
  • tag reviewer

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

Post merge:

  • Create a tag
  • Check new version is pushed to PyPi after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)

@openedx-webhooks
Copy link

Thanks for the pull request, @Ian2012! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 22, 2023
@Ian2012 Ian2012 force-pushed the cag/add-event-tracking branch 2 times, most recently from 3fa245a to 27cd650 Compare August 22, 2023 19:11
@Ian2012 Ian2012 changed the title Cag/add event tracking feat: add tracking log for completion events Aug 22, 2023
@@ -126,6 +131,20 @@ def submit_completion(self, user, block_key, completion):
"BlockCompletion.objects.submit_completion should not be \
called when the feature is disabled."
)

tracker.emit(
str(BLOCK_COMPLETION_CHANGED_EVENT_TYPE),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a str here? I think based on our slack conversation this should get moved into its own method and accept the model instance?

@bmtcril
Copy link

bmtcril commented Aug 23, 2023

Pinged the last couple of people who seem to have done work in this repo, lmk if there are better reviewers. 😄

@@ -41,7 +41,7 @@ def setUp(self):
self.set_up_completion()

def test_changed_value(self):
with self.assertNumQueries(6): # Get, update, 2 * savepoints, 2 * exists checks
with self.assertNumQueries(7): # 2 * Get, update, 2 * savepoints, 2 * exists checks
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are a little concerning, do you know where the extra queries are coming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one additional for the obj.emit_tracking_log() method.

@Ian2012
Copy link
Contributor Author

Ian2012 commented Aug 25, 2023

Hey @mphilbrick211! Is there any reviewer for this PR?

This tracking log is really important for aspects

@mphilbrick211 mphilbrick211 requested a review from a team August 28, 2023 17:54
@mphilbrick211
Copy link

Hi @openedx/masters-devs-cosmonauts! Would someone please be able to get this reviewed/merged for us? Thanks!

@mphilbrick211 mphilbrick211 added the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Aug 28, 2023
@zacharis278
Copy link
Contributor

@mphilbrick211 adding a ticket to our backlog to handle the merge and release for this

@Ian2012 Ian2012 force-pushed the cag/add-event-tracking branch 3 times, most recently from 76d942b to 91b2087 Compare September 4, 2023 16:27
@Ian2012
Copy link
Contributor Author

Ian2012 commented Sep 6, 2023

@zacharis278 Is there anything else we need to do before merging this PR?

@mphilbrick211
Copy link

Hi @zacharis278! Is there an ETA on this? I know you mentioned it was being added to your backlog.

Checking in because it's directly blocking this PR which is important to the Aspects work. Please let us know if there's any updates. Thanks!

@Ian2012
Copy link
Contributor Author

Ian2012 commented Sep 21, 2023

cc @UsamaSadiq @zubairshakoorarbisoft Can you take a look at this PR?

This is really important event for the Aspects project

@bmtcril
Copy link

bmtcril commented Sep 21, 2023

Looks good to me!

Copy link
Member

@UsamaSadiq UsamaSadiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@UsamaSadiq UsamaSadiq merged commit 9c84fe9 into openedx:master Sep 21, 2023
8 checks passed
@openedx-webhooks
Copy link

@Ian2012 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@bmtcril
Copy link

bmtcril commented Sep 25, 2023

Hi @UsamaSadiq thanks for merging, can someone roll a release as well? Looks like there hasn't been one in a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U waiting for eng review PR is ready for review. Review and merge it, or suggest changes.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants